<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option" ref="table"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import {newProductRegisterStyleNumApi} from '@/feature/pdt/infra/api/newProductRegisterStyleNumApi'
import CURDTable from '@/framework/components/table/CURDTable'
import DateUtil from "@/framework/infra/util/DateUtil";
import {adminApi} from "@/feature/mgr/infra/api/adminApi";
import DateType from "@/framework/constant/DateType";
import {storeApi} from "@/feature/mct/infra/api/storeApi";

export default {
  components: {CURDTable},
  data() {
    return {
      option: {
        requestApi: newProductRegisterStyleNumApi,
        showSelection: false,
        dialogWidth: '500px',
        opFixed: false,
        columns: [
          {
            label: '店铺',
            prop: 'storeId',
            searchable: true,
            width: 120,
            span: 24,
            sortable: 'custom',
            type: ColumnType.SELECT,
            required: true,
            options: storeApi.options()
          },
          {
            label: '选款总数',
            prop: 'num',
            span: 24,
            required: true,
            type: ColumnType.NUMBER
          },
          {
            label: '选款人',
            prop: 'userId',
            options: adminApi.listAll(),
            searchable: true,
            span: 24,
            required: true,
            // hiddenInForm: true,
            type: ColumnType.SELECT
          },
          {
            label: '选款日期',
            span: 24,
            required: true,
            type: ColumnType.DATE,
            prop: 'styleDate',
            defaultValue: DateUtil.currentDate(),
            searchOption: {
              options: {
                type: DateType.DATERANGE
              }
            },
            searchable: true
          },
          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

